#include "CGame.h"

BOOL CGame::GameInit(){
	m_PlayerTex= new CTexture();
	m_GroundTex= new CTexture();
	m_Cam= new CCamera();
	if(!m_PlayerTex->Load("chara.png",256.0f,128.0f))
		return FALSE;
	if(!m_GroundTex->Load("block.jpg",64.0f,64.0f))
		return FALSE;
	if(!m_cmap.MapInit())
		return FALSE;
	return TRUE;
}

void CGame::GameFin(){
	SAFE_DELETE(m_Cam);
	SAFE_DELETE(m_PlayerTex);
	SAFE_DELETE(m_GroundTex);
	m_cmap.MapFin();
}

void CGame::GameUpdate(){
	m_player.KeyUpdate();
	m_player.Update();
}

void CGame::GameDraw(){
	m_Cam->Run();
	DX.BeginSprite();
	m_player.Draw();
	m_cmap.Draw();
	DX.EndSprite();
}